﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="list.aspx.cs" Inherits="Leader_Celebrity_list" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <Custom:Header runat="server" />
    <style>
        .pupbox{width:300px;padding:20px;}
    </style>
    <script type="text/javascript">
        $(function() {
            $("a:contains(添加)").click(function() {
                location = "post.aspx";
                return false;
            });
            var _url = "/ajaxdata/leader/";
            $("a:contains(删除)").click(function () {
                var ids = "";
                $("input[name=checkboxid]:checked").each(function () {
                    ids += $(this).val() + ","
                });
                if (ids == "") {
                    alert("未选中任何待删除记录");
                } else {
                    $.ajax({
                        url: _url,
                        dataType: "json",
                        data: { action: "clb_del", ids: ids },
                        success: function (data) {
                            if (data.succ) {
                                $("input[name=checkboxid]:checked").each(function () {
                                    $("tr[rcid=" + $(this).val() + "]").remove();
                                });

                            } else {
                                alert(data.msg);
                            }
                        },
                        error: function (req) {
                            alert("提交发生意外。");
                        },
                        beforeSend: function () {

                        },
                        complete: function () {

                        }
                    });
                }
                return false;
            });
        })
    </script>
</head>
<body>
    <form runat="server">
        <Custom:ToolBar ID="ToolBar" runat="server" />
        <table  border="0" class="tabList" align="center" cellpadding="0" cellspacing="1">
        <tr class="tbhead">
            <td width="60" align=center>
                全<input type="checkbox" id="chkall" />选
            </td>
            <td>
              专访名人
            </td>
            <td>专访时间</td>
            <td>
                专访封面
            </td>
            <td>操作</td>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
                <tr rcid="<%#Eval("id") %>">
                <td>
                    <div align="center">
                        <input name="checkboxid" type="checkbox" value="<%#Eval("ID") %>" />
                    </div>
                </td>
                <td >
                   <%#Eval("name")%>
                </td>
                <td><%#Eval("VisitedDate")%></td>
                <td><img src="<%#Eval("img") %>" onerror="$(this).hide();" onload="changeImg(this,150,150)" /></td>
                <td>
                    <a class="edit" href="post.aspx?id=<%#Eval("id") %>">修改</a>
                </td>
            </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
   </form>
</body>
</html>
